package com.tt.dp.command;

public class MacroCommand implements Command{

    private Command[] commands;

    public MacroCommand(Command[] commands){
        this.commands = commands;
    }

    public void execute() {

        for (int i = 0; i < this.commands.length; i++) {
            this.commands[i].execute();
        }

    }

    public void undo() {

        for (int i = 0; i < this.commands.length; i++) {
            this.commands[i].undo();
        }
    }
}
